import type { initialOptions, menuListType } from './useSide.d.ts';
let initialHas: boolean = false;
let currentMenuList: menuListType[] = [];
let useSetMenuList: Function = () => {};
let isShow = true
let setMenuList = () => {
    useSetMenuList(isShow ? currentMenuList : []);
}
const callBack = (fn:Function) => {
    useSetMenuList = fn;
}
const sideSwitch = (target:boolean) => {
    isShow = target
    setMenuList()
}
const useSide = (initialOptions?: initialOptions) => {
    return {
        currentMenuList,
        setMenuList,
        setSideFn: callBack,
        isShow,
        sideSwitch
    }
};

export default useSide;